{extend name="../../admin/view/public/admin"}

{block name='content'}

<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}文章
    	<small>{if !empty($item)}(名称: {$item['title']}){/if}</small>
    </span>
</div>

<div class="page-content">

    <div class="alert alert-warning">
        <p>提示:只允许发布原创文章或经验分享，禁止转载或复制，违规将导致禁止发布或账号封禁!</p>
        <p>备注:文章发布以后，需要审核后才能显示在全平台，审核时间一般在1-2天内完成，请耐心等待。</p>
    </div>

    <form action="" method="post" class="form-validate form-horizontal ">
        <input type="hidden" name="category_id" value=""/>

        <div class="form-group">
            <label class="col-lg control-label">文章分类</label>
            <div class="col-sm-9 col-xs-12">
                <select name='cateid' class='form-control'>
                    <option value="">选择主分类</option>
                    {foreach $categoryList as $key => $row}
                    <option value="{$row['id']}" {if $row['id']==$item['cateid']}selected{/if}>{$row['name']}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">文章标题</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="title" class="form-control" value="{$item['title']}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">文章标签</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="tags" class="form-control" value="{$item['tags']}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">文章内容</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_ueditor('content',$item['content'],array('height'=>'300'))}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                <input type="submit" class="btn btn-primary" value="保存">
                <a class="btn btn-default" href="javascript:;" onclick="history.go(-1)">返回列表</a>
            </div>
        </div>

    </form>
</div>


{/block}